<?php

namespace App;

use DateTimeInterface;
use Illuminate\Database\Eloquent\Model;

class Commission extends Model
{
    protected $guarded=[];

    public function order()
    {
        return $this->belongsTo(Order::class,'order_number','order_number');
    }
    public function user()
    {
        return $this->belongsTo(User::class,'order_uid','id');
    }
    protected function serializeDate(DateTimeInterface $date)
    {
        return $date->format('Y-m-d H:i:s');
    }
    public function promotion()
    {
        return $this->belongsTo(User::class,'uid','id');
    }
}
